import 'package:flutter/material.dart';

/**
* 创建人：xuqing
* 创建时间 ：2020年2月4日21:39:42
* nutpi.net
 *
 */

class MenuItem extends StatelessWidget {
  final IconData? icon;
  final String? title;
  final VoidCallback? onPressed;
  MenuItem({Key? key, this.icon, this.title, this.onPressed}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return GestureDetector(
      onTap: onPressed,
      child: Column(
        children: <Widget>[
          Padding(
              padding: const EdgeInsets.only(
                left: 20.0,
                top: 12.0,
                right: 20.0,
                bottom: 10.0,
              ),
              child: Row(
                children: <Widget>[
                  const Padding(
                    padding: EdgeInsets.only(
                      right: 8.0,
                    ),
                  ),
                  Expanded(
                      child: Text(
                    title!,
                    style:
                        const TextStyle(color: Colors.black54, fontSize: 16.0),
                  )),
                  const Icon(
                    Icons.chevron_right,
                    color: Colors.grey,
                  )
                ],
              )),
          const Padding(
            padding: EdgeInsets.only(left: 20.0, right: 20.0),
            child: Divider(
              height: 2.0,
              color: Colors.black54,
            ),
          )
        ],
      ),
    );
  }
}
